package mygang.dao;

import mygang.model.constructor.Form;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

/**
 *
 * @author Volodymyr Lavrynovych <volodya.lavrynovych@gmail.com>
 * date: 22/09/2012
 */
@Repository("constructorDAO")
@Transactional
public class ConstructorDAOImpl extends AbstractDAO implements ConstructorDAO {

    public ConstructorDAOImpl(){}

    public Form getForm(long formId, long entityId) {
        Form form = getHibernateTemplate().load(Form.class, formId);
        return form;
//        List<Form> forms = hibernateTemplate.find("from Form f where f.id = ?", formId);
//        return !forms.isEmpty() ? forms.get(0) : new Form();
    }

}